import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router'

@Component({
  selector: 'app-extract-train',
  templateUrl: './extract-train.component.html',
  styleUrls: ['./extract-train.component.scss']
})
export class ExtractTrainComponent implements OnInit {
  step: number = 1;

  lineChart = {
    title: {
      text: '验证集变化'
    },
    grid:{
      top:"80px",
      left:"50px",
      right:"50px",
      bottom:"150px"
    },
    tooltip: {},
    legend: {
      data: ['销量']
    },
    xAxis: {
      name: "训练次数",
      data: ["10", "20", "30", "40", "50", "60", "70", "80", "90", "100"]
    },
    yAxis: { name: "验证集" },
    series: [{
      name: '销量',
      type: 'line',
      data: [15, 20, 36, 20, 12, 20, 15, 17, 13, 19]
    }]
  };

  constructor(private router:Router) { }

  ngOnInit() {
  }

  startTrain() {
    this.step = 2;

    setTimeout(() => {
      this.step = 0;
    }, 1500);

    setTimeout(() => {
      this.step = 3;
    }, 4000);
  }
  return(){
    this.router.navigate(['/extract/extractModel']);
  }

  nextStep(){
    this.router.navigate(['/extract/extractModelAssessment']);
  }
}
